import com.pojo.SysDept;
import com.service.SysDeptService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class test1 {
    @Test
    public void testList() {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        SysDeptService deptService = context.getBean(SysDeptService.class);
        List<SysDept> sysDepts = deptService.selectDeptList(null);
        List<SysDept> treeList = deptService.buildDeptTree(sysDepts);
        System.out.println(treeList);
    }

}

